<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>山西煤炭现货公路交易系统客户端</title>
<link href="<s:url value="/resources"/>/css/style_new.css" rel="stylesheet" type="text/css" />
<link href="<s:url value="/resources"/>/css/main_new.css" rel="stylesheet" type="text/css" />
<script src="<s:url value="/resources"/>/js/jquery.js"
	type="text/javascript"></script>
	 <%
 	String toid = (String) request.getSession().getAttribute("toid");
	 toid="39";
   %>
	<script type="text/javascript">
$(function(){  
    loadUserInfo();
    
 }); 
function openwindow(url,id){
	  
	   var toid=id;
	   url=url+id;
	   //alert(toid);
	    var sheight = screen.height-70;
	    var swidth = screen.width-10;
	    var iTop = (window.screen.availHeight-30-sheight)/2;       //获得窗口的垂直位置;
	    var iLeft = (window.screen.availWidth-10-swidth)/2;           //获得窗口的水平位置;
	    var winoption ="height="+sheight+",width="+ swidth +",top="+iTop+",left="+iLeft+",toolbar=no,menubar=no,scrollbars=yes, resizable=yes,status=no";
	   
	    window.open("<s:url value="/"/>/htgl/"+url,"_blank",winoption);
 
	}
	

 function loadUserInfo(){
     var url = "common/loadUser"
     $.post(url,function(data){
       var json = eval('(' + data + ')');
       //alert(json.orgname+json.rolename+json.username);
       //console.log(json);	
       $("#orgname").html(json.orgname);
       $("#rolename").html(json.rolename);
       $("#username").html(json.username);
       $("#message").html(json.orgname +"    " + json.rolename + "    " +json.username);
       var toid=json.toid;
       var mmbz=json.mmbz;
       var htid=json.htid;
        
       if(toid!=""&&toid!=null){
    	   if(mmbz!=""&&mmbz!=null&&mmbz=="1"){
    		    
    		   //if(htid!=""&&htid!=null&&htid=="0"){
    		   //   openwindow('../htgl/findAddDsddRcbdView?toid=',toid);
    		   //}else{
    		      openwindow('../htgl/findDshtDetail?hetid='+htid+'&toid=',toid);
    		   //}
    	   }else if(mmbz!=""&&mmbz!=null&&mmbz=="0"){
    		    
    		   if(htid!=""&&htid!=null&&htid=="0"){
    			   //打开认购列表页面
    			   //window.location.href="../htgl/findDshtView";
    			   alert("请等待挂单方起草合同后再进行确认。");
    		   }else{
    			   
    			   openwindow('../htgl/findDshtqrDetail?hetid=',htid);
    		   }
    		   
    	   }else{
    		   
    	   }
       }
       
     });
 }

</script>
</head>

<body>
<div class="header">
 <div class="main-logo l"><img src="<s:url value="/resources"/>/img/logo_03.png" width="422" height="30" /></div>
 <div class="main-logo-text r">
     <span class="main-logo-text-span l" id="orgname"> </span>&nbsp;&nbsp;&nbsp;&nbsp;
     <span class="main-logo-text-span l" id="username"> </span>
     <ul class="main-logo-text-ul r"><li class="mr20"><a href="jysxx/updatepwd" target="main" ><img src="<s:url value="/resources"/>/img/dl_06.png" width="69" height="18"  title="修改密码"/></a></li>
     <li><a href="#" onclick=top.location.replace("login/logout")><img src="<s:url value="/resources"/>/img/dl_08.png" width="69" height="18"  title="退出系统"/></a></li>
     </ul> 
 </div>
 <div class="clear"></div>
</div>
<div class="menu">
  <iframe src="user/findMenu" name="menu" class="iframe" frameborder="0"></iframe>
</div>
<div class="title">
<a href="#" id="menutitle"></a> </div>
<div class="content">
 <%
 	String appId = (String) request.getSession().getAttribute("appid");
 	String mt_chose = (String) request.getSession().getAttribute("mt_chose");
 	if (null != appId && appId.equals("3")) {// 邀约系统
	  if (null != mt_chose && mt_chose.equals("0")) {
		  %>
		  <script type="text/javascript">
		  var　mt0 = document.getElementById("menutitle"); 
		　  mt0.innerText ="当前位置：签订铁路合同";
		  </script>
		  <iframe src="<s:url value="/"/>/htgl/findRcbdView" name="main" class="iframe" frameborder="0" id="main"></iframe>
		  <%
	  }
	  else if (null != mt_chose && mt_chose.equals("1")) {
		  %>
		   <script type="text/javascript">
		  var　mt1 = document.getElementById("menutitle"); 
		　  mt1.innerText ="当前位置：电子合同";
		  </script>
		  <iframe src="<s:url value="/"/>/gpjy/dianzhtlist" name="main" class="iframe" frameborder="0" id="main"></iframe>
		  <%
	  }
	  else if (null != mt_chose && mt_chose.equals("2")) {
		  %>
		   <script type="text/javascript">
		  var　mt2 = document.getElementById("menutitle"); 
		　  mt2.innerText ="当前位置：签订电商合同";
		  </script>
		  <iframe src="<s:url value="/"/>/htgl/findDshtView" name="main" class="iframe" frameborder="0" id="main"></iframe>
		  <%
	  }else if (null != mt_chose && mt_chose.equals("3")) {
		  %>
		   <script type="text/javascript">
		  var　mt3 = document.getElementById("menutitle"); 
		　  mt3.innerText ="当前位置：签订补充协议";
		  </script>
		  <iframe src="<s:url value="/"/>/htgl/findDsBcxyView" name="main" class="iframe" frameborder="0" id="main"></iframe>
		  <%
	  }else{
		  %>
		  <iframe src="mtzq_html/classify.html" name="main" class="iframe" frameborder="0" id="main"></iframe>
		  <%  
	  }
   
 	}else if (null != appId && appId.equals("7")) {
 		if (null != mt_chose && mt_chose.equals("2")) {
 			  %>
 			   <script type="text/javascript">
 			  var　mt4 = document.getElementById("menutitle"); 
 			　  mt4.innerText ="当前位置：月度合同";
 			  </script>
 			  <iframe src="<s:url value="/"/>/htgl/findYdhtView" name="main" class="iframe" frameborder="0" id="main"></iframe>
 			  <%
 		  }else{
 			  %>
 			  <iframe src="mtzq_html/classify1.html" name="main" class="iframe" frameborder="0" id="main"></iframe>
 			  <%  
 		  }
	}else{
		%>
		  <iframe src="mtzq_html/classify1.html" name="main" class="iframe" frameborder="0" id="main"></iframe>
		  <%  
	}
   %>
</div>
</body>
</html>
